package org.bigdata.platform.json.google;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;

import org.bigdata.platform.json.BaseJsonFileObject;

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.jayway.jsonpath.internal.spi.json.GsonJsonProvider;
import com.jayway.jsonpath.internal.spi.mapper.GsonMappingProvider;
import com.jayway.jsonpath.spi.json.JsonProvider;
import com.jayway.jsonpath.spi.mapper.MappingProvider;

public class GoogleGsonFileObject extends BaseJsonFileObject<JsonElement> {

	private JsonParser parser = new JsonParser();
	
	@Override
	public void readFrom(InputStream is) throws Exception {
		setRootNode(parser.parse(new InputStreamReader(is)));
	}

	@Override
	public void writeTo(OutputStream os) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected JsonProvider getJsonProvider() {
		return new GsonJsonProvider();
	}

	@Override
	protected MappingProvider getMappingProvider() {
		return new GsonMappingProvider();
	}

}
